package com.example.interceptor;

/**
 * Created by codedrinker on 2019/5/16.
 */


//@Configuration
//public class  WebConfig implements WebMvcConfigurer {
//    @Value("${custom.tmpLocation}")
//    private  String tmpLocation;
//    @Value("${avatar.file}")
//    private  String avatarLocation;
//    @Autowired
//    private SessionInterceptor sessionInterceptor;
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(sessionInterceptor).addPathPatterns("/**");
//    }
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/uploadimg/**")
//                .addResourceLocations("file:"+tmpLocation);
//        registry.addResourceHandler("/avatar/**")
//                .addResourceLocations("file:"+avatarLocation);
//    }
//}
